{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Garimpagem de Dados\n",
    "\n",
    "## Aula 4 - Exercídio de Classificação com kNN\n",
    "\n",
    "13/10/2017"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Dataset:** Titanic: Machine Learning from Disaster\n",
    "\n",
    "https://www.kaggle.com/c/titanic/data\n",
    "\n",
    "Partindo da aula passada:\n",
    "\n",
    "1. Atualizar a função que mede a distância euclidiana para o pacote do scikit-learn \n",
    "\n",
    "2. Implementar uma função que selecione os k vizinhos mais próximos (k > 1)\n",
    "\n",
    "3. Implementar uma função que recebe os k vizinhos mais próximos e determinar a classe correta\n",
    "\n",
    "4. Transformar as features categoricas em numéricas (tip: pandas ou scikit-learn)\n",
    "\n",
    "5. Analisar a necessidade de normalizar as features numéricas (tip: pandas ou scikit-learn)\n",
    "\n",
    "6. Selecionar as features baseada na correlação (tip: pandas)\n",
    "\n",
    "7. Separar o dataset em treino (75%) / teste (25%) / validação (10% do treino)\n",
    "\n",
    "4. Execute o classificador para 30 k's pulando de 4 em 4 e apresente todas as acurácias utilizando o dataset de validação (Qual o melhor k?) [plotar um gráfico com os resultados]\n",
    "\n",
    "5. Executar o classificador para o melhor k encontrado utilizando o dataset de teste e apresentar um relatório da precisão (tip: scikit-learn) [plotar um gráfico com os resultados]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from sklearn.metrics import classification_report, accuracy_score\n",
    "from sklearn.neighbors import DistanceMetric\n",
    "from sklearn.neighbors import KNeighborsClassifier\n",
    "from sklearn.preprocessing import LabelEncoder, MinMaxScaler\n",
    "from sklearn.model_selection import train_test_split\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "class KNNClassifier(object):\n",
    "    def __init__(self):\n",
    "        self.X_train = None\n",
    "        self.y_train = None\n",
    "        self.distance = DistanceMetric.get_metric(\"euclidean\")\n",
    "\n",
    "    def euc_distance(self,a, b):\n",
    "        return self.distance.pairwise([a], [b])[0,0]\n",
    "        \n",
    "    def closest(self, row, k):\n",
    "        dists = [(index,self.euc_distance(row, item)) for index,item in enumerate(self.X_train)]\n",
    "        dists.sort(key = lambda x: x[1])\n",
    "        nei = []\n",
    "        for i in range(k):\n",
    "            nei.append(self.y_train[dists[i][0]])\n",
    "        cl = Counter(nei).most_common(1)[0][0]\n",
    "        \n",
    "        return cl\n",
    "\n",
    "    def fit(self, training_data, training_labels):\n",
    "        self.X_train = training_data\n",
    "        self.y_train = training_labels\n",
    "\n",
    "    def predict(self, to_classify, k):\n",
    "        predictions = []\n",
    "        for row in to_classify:\n",
    "            labels = np.argmax(np.bincount(self.closest(row, k)))\n",
    "            predictions.append(labels)\n",
    "        return predictions"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>PassengerId</th>\n",
       "      <th>Survived</th>\n",
       "      <th>Pclass</th>\n",
       "      <th>Name</th>\n",
       "      <th>Sex</th>\n",
       "      <th>Age</th>\n",
       "      <th>SibSp</th>\n",
       "      <th>Parch</th>\n",
       "      <th>Ticket</th>\n",
       "      <th>Fare</th>\n",
       "      <th>Cabin</th>\n",
       "      <th>Embarked</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>Braund, Mr. Owen Harris</td>\n",
       "      <td>1</td>\n",
       "      <td>22.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>A/5 21171</td>\n",
       "      <td>7.2500</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>Cumings, Mrs. John Bradley (Florence Briggs Th...</td>\n",
       "      <td>0</td>\n",
       "      <td>38.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>PC 17599</td>\n",
       "      <td>71.2833</td>\n",
       "      <td>C85</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>Heikkinen, Miss. Laina</td>\n",
       "      <td>0</td>\n",
       "      <td>26.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>STON/O2. 3101282</td>\n",
       "      <td>7.9250</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>Futrelle, Mrs. Jacques Heath (Lily May Peel)</td>\n",
       "      <td>0</td>\n",
       "      <td>35.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>113803</td>\n",
       "      <td>53.1000</td>\n",
       "      <td>C123</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>Allen, Mr. William Henry</td>\n",
       "      <td>1</td>\n",
       "      <td>35.0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>373450</td>\n",
       "      <td>8.0500</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   PassengerId  Survived  Pclass  \\\n",
       "0            1         0       3   \n",
       "1            2         1       1   \n",
       "2            3         1       3   \n",
       "3            4         1       1   \n",
       "4            5         0       3   \n",
       "\n",
       "                                                Name  Sex   Age  SibSp  Parch  \\\n",
       "0                            Braund, Mr. Owen Harris    1  22.0      1      0   \n",
       "1  Cumings, Mrs. John Bradley (Florence Briggs Th...    0  38.0      1      0   \n",
       "2                             Heikkinen, Miss. Laina    0  26.0      0      0   \n",
       "3       Futrelle, Mrs. Jacques Heath (Lily May Peel)    0  35.0      1      0   \n",
       "4                           Allen, Mr. William Henry    1  35.0      0      0   \n",
       "\n",
       "             Ticket     Fare Cabin  Embarked  \n",
       "0         A/5 21171   7.2500     0         3  \n",
       "1          PC 17599  71.2833   C85         1  \n",
       "2  STON/O2. 3101282   7.9250     0         3  \n",
       "3            113803  53.1000  C123         3  \n",
       "4            373450   8.0500     0         3  "
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.read_csv('train.csv')\n",
    "df['Age'] = df.Age.fillna(df.Age.mean())\n",
    "df = df.where((pd.notnull(df)), 0)\n",
    "for f in [\"Sex\", \"Embarked\"]:\n",
    "    df[f] = df[f].astype('category')\n",
    "    df[f] = df[f].cat.codes\n",
    "\n",
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "features = [\"Pclass\",\"Sex\",\"Age\",\"SibSp\",\"Parch\",\"Fare\",\"Embarked\"]\n",
    "X = df.get(features)\n",
    "Y = df[\"Survived\"].values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "X_train, X_test, Y_train, Y_test = train_test_split(X, Y, test_size = 0.25)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "KNeighborsClassifier(algorithm='auto', leaf_size=30, metric='minkowski',\n",
       "           metric_params=None, n_jobs=1, n_neighbors=5, p=2,\n",
       "           weights='uniform')"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "knn = KNeighborsClassifier()\n",
    "knn.fit(X_train,Y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "predict = knn.predict(X_test)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.68609865470852016"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "accuracy_score(Y_test, predict)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYsAAAEKCAYAAADjDHn2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAIABJREFUeJzt3Xl8VOX1+PHPyUIgLCFhlyUJkVWg\nYBF3BNGKAiLWqhS3Vo1ttV+X1rrQurX4/Vqt1bZo5WfVqlGKltUNWVzigiWoZd8hIZBAgLCEBLKd\n3x8ziVkmzEwyd5bkvF+veZG589x7z82EOXPvfZ7ziKpijDHGnExUqAMwxhgT/ixZGGOM8cqShTHG\nGK8sWRhjjPHK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3SvqLOBw1eWqcCci44H7gMtVtbjGSwuBa0UkTkRScd28/4/XDapq\ni3wAl+HqIbANmB7qeBoR/3m4Th1XA9+6H5fhus6/DNji/jcp1LE24tjGAO+4f+7r/kPeCrwFxIU6\nPj+PZTiQ5X6f5gOJkfweAY8CG4G1wGtAXKS9R8CbuO65lOH6ln1zQ+8Jrks2M92fE2tw9QQL+TH4\neExbcd2bqPp8+HuN9tPdx7QJuNSXfdgIbmOMMV611MtQxhhj/GDJwhhjjFeWLIwxxnhlycIYY4xX\nliyMMcZ4ZcnCGAeJSErNSqDGRCpLFsYYY7yyZGFMkIhIX3dBwTNCHYsx/rJkYUwQuEt+/Bv4iaqu\nDHU8xvgrxnsTY0wTdcFVa+iHqrou1MEY0xh2ZmGM8w7jqtFzbqgDMaax7MzCGOeV4pp5bbGIFKnq\nG6EOyBh/WbIwJghU9Zh7gqclInJMVSOxjLdpwazqrDHGGK/snoUxxhivLFkYY4zxypKFMcYYryxZ\nGGOM8cqShTHGGK8sWRhjjPHKkoUxxhivLFkYY4zx6v8DHOI22Jv5nyEAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7efd2352bbe0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "accuracies = []\n",
    "for k_test in range(1, 120, 4):\n",
    "    knn = KNeighborsClassifier(n_neighbors=k_test)\n",
    "    knn.fit(X_train,Y_train)\n",
    "    accuracies.append(accuracy_score(Y_test, knn.predict(X_test)))\n",
    "\n",
    "plt.plot(range(1,120,4), accuracies, color='green', linestyle='dashed', marker='o' )\n",
    "plt.xlabel(\"k\")\n",
    "plt.ylabel(\"accuracy\")\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "             precision    recall  f1-score   support\n",
      "\n",
      "          0       0.82      0.79      0.81       156\n",
      "          1       0.56      0.60      0.58        67\n",
      "\n",
      "avg / total       0.74      0.74      0.74       223\n",
      "\n"
     ]
    }
   ],
   "source": [
    "best_k = 13\n",
    "knn = KNeighborsClassifier(n_neighbors=best_k)\n",
    "knn.fit(X_train,Y_train)\n",
    "best_accuracy = accuracy_score(Y_test, knn.predict(X_test))\n",
    "report = classification_report(knn.predict(X_test), Y_test)\n",
    "print(report)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
